#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
	const int length = 11;
	char A[length];
	char B[length];
	memset(A, 0, length);
	memset(B, 0, length);

	while (cin>>A>>B) {
		int i = 0;
		int a = 0, b = 0;
		for (i = 0; i < (int)strlen(A); i++) {
			a += (A[i] - '0');
		}	
		for (i = 0; i < (int)strlen(B); i++) {
			b += (B[i] - '0');
		}
		cout<< a*b<<endl;
	}
	return 0;
}